package com.zzmm.socket.qq.common;

import cn.hutool.core.util.ObjectUtil;
import lombok.Builder;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;

@Data
public class Message implements Serializable {

    private static final long serialVersionUID = -6849794234266710L;

    public boolean isSuccess() {
        return QQConstant.ResponseStatus.isSuccess(responseStatus);
    }

    private String sender;

    private String receiver;

    private Object content;

    private Integer messageType;

    private LocalDateTime dateTime;

    private int responseStatus;


    @Builder
    public Message(String sender,
                   String receiver,
                   Object content,
                   Integer messageType,
                   int responseStatus) {
        this.sender = sender;
        this.receiver = receiver;
        this.content = content;
        this.messageType = messageType;
        this.dateTime = LocalDateTime.now();
        this.responseStatus = responseStatus;
    }
}
